package com.dmx.platform.service.impl;

import com.dmx.fw.service.impl.BaseServiceImpl;
import com.dmx.platform.dao.OrderDao;
import com.dmx.platform.entity.TOrder;
import com.dmx.platform.service.OrderService;

/**
 *@author:Beni Yang
 *@date:2012-8-29
 *@function:
 */
public class OrderServiceImpl extends BaseServiceImpl  implements OrderService {

	private OrderDao orderDao;
	
	@Override
	public boolean deleteOrder(String orderId) {
		try{
			this.removeObject(TOrder.class, Integer.parseInt(orderId));
		}catch(Exception e){
			e.printStackTrace();
			return false;
		}
		return true;

	}

	@Override
	public TOrder getOrderById(String orderId) {
		try{
			return (TOrder)this.getObject(TOrder.class, Integer.parseInt(orderId));			
		}catch(Exception e){
			e.printStackTrace();
		}
		return null;

	}

	@Override
	public TOrder getOrderByPassword(String password,Integer businessId) {
		return orderDao.getOrderByPassword(password,businessId);

	}

	@Override
	public boolean saveOrUpdateOrder(TOrder order) {
		return orderDao.saveOrUpdateOrder(order);
	}

	

	public OrderDao getOrderDao() {
		return orderDao;
	}

	public void setOrderDao(OrderDao orderDao) {
		this.orderDao = orderDao;
	}

}
